package org.dromara.system.controller.talent;

import cn.dev33.satoken.annotation.SaCheckPermission;
import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.R;
import org.dromara.common.web.core.BaseController;
import org.dromara.system.domain.vo.*;
import org.dromara.system.service.IDashboardService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/talent/dashboard")
public class DashboardController extends BaseController {


    private final IDashboardService dashboardService;

    /**
     * 服务事项统计statistics
     */
    @SaCheckPermission("talent:dashboard:serviceItemStatistics")
    @GetMapping("/serviceItemStatistics")
    public R<List<ServiceItemStatisticsVo>> serviceItemStatistics() {
        List<ServiceItemStatisticsVo> serviceItemStatistics = dashboardService.serviceItemStatistics();
        return R.ok(serviceItemStatistics);
    }

    @SaCheckPermission("talent:dashboard:newFengjieCount")
    @GetMapping("/getNewFengjieCount")
    public R<Long> newFengjieCount() {
        Long count = dashboardService.getNewFengjieCount();
        return R.ok(count);
    }


    @SaCheckPermission("talent:dashboard:newFengjieByLevel")
    @GetMapping("/newFengjieByLevel")
    public R<List<NewFengjieByLevelVo>> newFengjieByLevel() {
        return R.ok(dashboardService.newFengjieByLevel());
    }

    @SaCheckPermission("talent:dashboard:newFengjieByDegree")
    @GetMapping("/newFengjieByDegree")
    public R<List<NewFengjieByDegreeVo>> newFengjieByDegree() {
        return R.ok(dashboardService.newFengjieByDegree());
    }

    @SaCheckPermission("talent:dashboard:newFengjieByProfessionalSkill")
    @GetMapping("/newFengjieByProfessionalSkill")
    public R<List<NewFengjieByProfessionalSkillVO>> newFengjieByProfessionalSkill() {
        return R.ok(dashboardService.newFengjieByProfessionalSkill());
    }


    @SaCheckPermission("talent:dashboard:newFengjieBySkillTalent")
    @GetMapping("/newFengjieBySkillTalent")
    public R<List<NewFengjieBySkillTalentVo>> newFengjieBySkillTalent() {
        return R.ok(dashboardService.newFengjieBySkillTalent());
    }

    @SaCheckPermission("talent:dashboard:newFengjieByXiangzhen")
    @GetMapping("/newFengjieByXiangzhen")
    public R<List<NewFengjieByXiangzhenVo>> newFengjieByXiangzhen() {
        return R.ok(dashboardService.newFengjieByXiangzhen());
    }


    @SaCheckPermission("talent:dashboard:newFengjieByIndustryCategory")
    @GetMapping("/newFengjieByIndustryCategory")
    public R<List<NewFengjieByIndustryCategoryVo>> newFengjieByIndustryCategory() {
        return R.ok(dashboardService.newFengjieByIndustryCategory());
    }


    @SaCheckPermission("talent:dashboard:newFengjieByYear")
    @GetMapping("/newFengjieByYear")
    public R<NewFengjieByYearVo> newFengjieByYear() {
        NewFengjieByYearVo yearVo = dashboardService.newFengjieByYear();
        return R.ok(yearVo);
    }

}
